package com.hzncc.flowable_diboot.excel.model;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.diboot.core.data.copy.Accept;
import com.diboot.core.util.D;
import com.diboot.file.excel.BaseExcelModel;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
* 客户 导出model定义
*
* @author MyName
* @version 1.0
* @date 2024-06-21
 * Copyright © MyCorp
*/
@Getter
@Setter
@ExcelIgnoreUnannotated
public class CustomerExportModel extends BaseExcelModel {


    /**
    * 租户
    */
    @ExcelProperty(value = "租户")
    private String tenantIdLabel;

    /**
    * 名称
    */
    @ExcelProperty(value = "名称")
    private String name;


    /**
    * SAP客户编号
    */
    @ExcelProperty(value = "SAP客户编号")
    private String sn;


    /**
    * 客户来源
    */
    @Accept(name = "sourceLabel.label")
    @ExcelProperty(value = "客户来源")
    private String sourceLabel;

    /**
    * 客户级别
    */
    @Accept(name = "rankLabel.label")
    @ExcelProperty(value = "客户级别")
    private String rankLabel;

    /**
    * 客户行业
    */
    @Accept(name = "businessLabel.label")
    @ExcelProperty(value = "客户行业")
    private String businessLabel;

    /**
    * 客户标签
    */
    @ExcelProperty(value = "客户标签")
    private String label;


    /**
    * 成交状态
    */
    @ExcelProperty(value = "成交状态")
    private String status;


    /**
    * 最后跟进时间
    */
    @DateTimeFormat(D.FORMAT_DATETIME_Y4MDHMS)
    @ExcelProperty(value = "最后跟进时间")
    private LocalDateTime lastFollwUpTime;


    /**
    * 详细地址
    */
    @ExcelProperty(value = "详细地址")
    private String address;


    /**
    * 距进入公海天数
    */
    @ExcelProperty(value = "距进入公海天数")
    private String expirationTime;


    /**
    * 负责人
    */
    @ExcelProperty(value = "负责人")
    private String principalLabel;

    /**
    * 所属部门
    */
    @ExcelProperty(value = "所属部门")
    private String dept;


    /**
    * 进入公海天数
    */
    @ExcelProperty(value = "进入公海天数")
    private Long enterDays;


    /**
    * 进入公海时间
    */
    @DateTimeFormat(D.FORMAT_DATETIME_Y4MDHMS)
    @ExcelProperty(value = "进入公海时间")
    private LocalDateTime enterTime;


    /**
    * 进入公海理由
    */
    @ExcelProperty(value = "进入公海理由")
    private String enterReason;
    private Boolean isEnter;
    /**
    * 是否进入公海
    */
    @ExcelProperty(value = "是否进入公海")
    private String isEnterLabel;

    /**
    * 下次联系时间
    */
    @DateTimeFormat(D.FORMAT_DATETIME_Y4MDHMS)
    @ExcelProperty(value = "下次联系时间")
    private LocalDateTime nextConnectTime;


    /**
    * 省
    */
    @ExcelProperty(value = "省")
    private String province;


    /**
    * 市
    */
    @ExcelProperty(value = "市")
    private String city;


    /**
    * 统一信用代码
    */
    @ExcelProperty(value = "统一信用代码")
    private String creditCode;


    /**
    * 税号
    */
    @ExcelProperty(value = "税号")
    private String taxNumber;

    public void setIsEnter(Boolean isEnter) {
        this.isEnter = isEnter;
        if (isEnter != null) {
            this.isEnterLabel = isEnter.booleanValue() ? "是" : "否";
        }
    }
}